﻿<dialogs:DialogWindow x:Class="Mnk.TBox.Core.PluginsShared.ScriptEngine.EditorDialog"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:loc="clr-namespace:Mnk.TBox.Core.PluginsShared.Code.Localization"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                                     xmlns:dialogs="clr-namespace:Mnk.Library.WpfControls.Dialogs;assembly=Mnk.Library.WPFControls"
                      xmlns:wpfSyntaxHighlighter="clr-namespace:Mnk.Library.WpfSyntaxHighlighter;assembly=Mnk.Library.WPFSyntaxHighlighter"
                      mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" 
             WindowStartupLocation="CenterScreen" ShowInTaskbar="True"
             Title="{loc:Tr SourcesEditor}"
             Width="480" Height="340"
             MinWidth="480" MinHeight="340" >
    <DockPanel>
        <DockPanel Dock="Top">
            <Label Content="{loc:Tr File}" DockPanel.Dock="Left"/>
            <ComboBox Name="Files" HorizontalAlignment="Stretch" VerticalAlignment="Center" IsEditable="False" SelectionChanged="OnSelectFile"/>
        </DockPanel>
        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10">
            <Button Content="{loc:Tr Save}"  Click="SaveClick" IsEnabled="{Binding Path=IsEnabled, ElementName=Files}" />
            <Button Content="{loc:Tr Build}"  Click="BuildClick" IsEnabled="{Binding Path=IsEnabled, ElementName=Files}" IsDefault="True"/>
            <Button Content="{loc:Tr Cancel}" Click="CancelClick" IsCancel="True"/>
        </StackPanel>
        <Grid >
            <Grid.RowDefinitions>
                <RowDefinition Height="4*" MinHeight="64"/>
                <RowDefinition Height="5"/>
                <RowDefinition Height="*" MinHeight="64"/>
            </Grid.RowDefinitions>
            <wpfSyntaxHighlighter:SyntaxHighlighter Name="Source" Format="cs" Grid.Row="0" IsEnabled="{Binding Path=IsEnabled, ElementName=Files}" TextChanged="SourcesChanged"/>
            <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" />
            <TextBox Name="Output" Grid.Row="2" IsReadOnly="True" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap"/>
        </Grid>
    </DockPanel>
</dialogs:DialogWindow>
